<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>activity-登陆</title>
    <link rel="stylesheet" href="resource/layui/css/layui.css">
    <link rel="stylesheet" href="resource/css/login.css">
    <script src="resource/js/jquery-1.11.1.min.js"></script>
    <script src="resource/layui/layui.js"></script>
  </head>
  <body>
  <div id="container">
    <div></div>
    <div class="admin-login-background">

      <form method="post" class="layui-form" action="login" onsubmit="return checkForm()" >
        <div>
          <i class="layui-icon layui-icon-username admin-icon admin-icon-username"></i>
          <input type="text" id="userName" name="userName" placeholder="请输入用户名"
                 autocomplete="off"
                 class="layui-input admin-input admin-input-username">
        </div>
        <div>
          <i class="layui-icon layui-icon-password admin-icon admin-icon-password"></i>
          <input id="password"  type="password" name="password"
                 placeholder="请输入密码"
                 autocomplete="off"
                 class="layui-input admin-input">
        </div>
        <%-- <div>
            <input type="text" name="verify" placeholder="请输入验证码"  autocomplete="off" class="layui-input admin-input admin-input-verify">
            <img class="admin-captcha" src="" onclick="updateVerify()">
          </div>--%>
        <button class="layui-btn admin-button" lay-submit lay-filter="formDemo">登陆</button>


      </form>
    </div>
  </div>

  <script type="text/javascript">
      var layer  ;
      //JavaScript代码区域
      layui.use(['element','layer'], function(){
          var element = layui.element,
              layer=layui.layer;
              var msg = "${msg}";
              var userName = "${userName}";
              if(msg){
                  layer.msg(msg);
              }
              if(userName){
                  $("#userName").val(userName);
              }

      });

      function checkForm() {

          var userName = $("#userName").val();
          var password = $("#password").val();
          if(!userName){
              layer.msg("用户名不能为空");
              return false;
          }
          if(!password){
              layer.msg("密码不能为空");
              return false;
          }
          return true;
      }
  </script>



  </body>
</html>
